//
//  AccountSecurityTableViewCell.m
//  ChineseCollegeStudentsNetwork
//
//  Created by 刘喆 on 2018/5/21.
//  Copyright © 2018年 刘喆. All rights reserved.
//

#import "AccountSecurityTableViewCell.h"

@implementation AccountSecurityTableViewCell

#pragma mark - Init
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self createSubviews];
    }
    return self;
}

- (UILabel *)stateL {
    
    if (!_stateL) {
        _stateL = [[UILabel alloc] init];
        _stateL.font = [UIFont systemFontOfSize:13];
        _stateL.textColor = kRGB(153, 153, 153, 1);
    }
    return _stateL;
    
}

- (UILabel *)prompt {
    
    if (!_prompt) {
        _prompt = [[UILabel alloc] init];
        _prompt.font = [UIFont systemFontOfSize:13];
        _prompt.textColor = kRGB(153, 153, 153, 1);
    }
    return _prompt;
    
}

- (UIImageView *)accessoryImgv {
    if (!_accessoryImgv) {
        _accessoryImgv = [[UIImageView alloc] init];
        _accessoryImgv.image = [UIImage imageNamed:@"mine_arrow_r"];
    }
    return _accessoryImgv;
}

#pragma mark - Subviews
#pragma amrk layout subviews
- (void)layoutSubviewsInView{
    
    [_stateL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_offset(20);
        make.centerY.equalTo(self);
    }];
    
    [_accessoryImgv mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_offset(-20);
        make.width.height.mas_equalTo(10);
        make.centerY.equalTo(self);
    }];
    
    [_prompt mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_offset(-40);
        make.centerY.equalTo(self);
    }];
    
}


#pragma mark create subviews
- (void)createSubviews {
    
    [self.contentView addSubview:self.stateL];
    [self.contentView addSubview:self.accessoryImgv];
    [self.contentView addSubview:self.prompt];
    [self layoutSubviewsInView];
}

@end
